Skip to content

build: target host arch for local builds/envtest#2076

Merged
stealthybox merged 1 commit into
mainfrom
build-native-arch
Jun 8, 2026
Merged

build: target host arch for local builds/envtest#2076
stealthybox merged 1 commit into
mainfrom
build-native-arch

Conversation

@stealthybox

Copy link
Copy Markdown
Member

On arm64 hosts, builds would use amd64 for both:

  • ENVTEST_ARCH test binaries
  • BUILD_PLATFORMS for make docker-build

So local builds and tests run under emulation (Rosetta) on arm64 hosts, which is slow and occasionally hides subtle runtime bugs like the ones i ran into testing helm-controller. envtest publishes native arm64 binaries now (including darwin/arm64), so the pin and Darwin override is no longer needed.

now:

  • ENVTEST_ARCH follows the host arch
  • BUILD_PLATFORMS defaults to linux/<host arch> so make docker-build makes a native image

overrides still work:
make docker-build BUILD_PLATFORMS=linux/amd64,linux/arm64,linux/arm/v7

Multi-arch release images come from the fluxcd/gha-workflows release flow, not make docker-build, so release artifacts are untouched.
I ran all tests and docker-builds across the 9 repos via apple silicon

tracking: fluxcd/flux2#5931

@stealthybox stealthybox added the area/testing Testing related issues and pull requests label Jun 8, 2026
Local container image builds and envtest binaries were pinned to amd64,
forcing emulation (Rosetta) on Apple Silicon and other arm64 hosts. This
produced amd64 controller images and amd64 envtest binaries locally, which
can surface subtle runtime bugs.

envtest now publishes arm64 binaries (including darwin/arm64), so the
historical amd64 pin and the Darwin-specific override are no longer needed.

Derive the architecture from the host Go toolchain (go env GOARCH):
- ENVTEST_ARCH now follows the host architecture.
- BUILD_PLATFORMS defaults to linux/<host arch> so 'make docker-build'
  produces a native image.

Multi-arch release images are built by the fluxcd/gha-workflows release
workflow, not by 'make docker-build', so release artifacts are unaffected.
Both values remain overridable for cross-arch builds.

Signed-off-by: leigh capili <leigh@null.net>
@stealthybox stealthybox merged commit cee0719 into main Jun 8, 2026
6 checks passed
@stealthybox stealthybox deleted the build-native-arch branch June 8, 2026 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/testing Testing related issues and pull requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants